format code
optimized code for long lived connections