Remove unnecessary tests
s/socket/connection/g
Use generators behaviour in request processing
Remove unnecessary type definition