Refactoring of server intialization