General clean up
Move environment to handle_connection() instead of main()