Worker pattern added. Refactoring done.