Code Cleanup, and client/service split