Massive refactor on server side for workers