refactored main out of server, decoupled app from sockethandler