Refactoring structure to better support client / server seperation