Refactored Worker-Server messages to two factory classes