move the getHead function and status404Line to util