refactor files and server