Server.rb refactor