refactor(server): refactor config, controller, server.js