reduced/refactored code to the bare minimum of server handling