Replaced some repetitive headers by a logging function