move the lobby functionality to its own file, enhance it a bit