header code refactored to separate files.