add welcome function
extract closing connection to close method
separate handling of client from running of server