Split watch task
Clean up server code