Refactoring server and client into separate packages