more refactoring, finishing header