Refactoring server & main.go