Header design, code cleanup