Removed duplicate code from workers