Refactored page output
Many changes
More code cleanup