break out accept
move accept further to top of file
split socket and session from each other
add (c) boilerplate