Added page header, refactored code