Add custom header test, remove unused variables
Remove old code