Refactor complete: single-threaded HTTP server connection