Adding multithreading support to the application