Moved worker class to its own file