headerOnLoad code factorized