refactor server config