Refactored server.rb to extract print methods into a separate controller