Refactoring. Added queue for workers, fixed size of the pool.