Improved custom header implementation.