better name
move writeHead to later part