Structured the file using WP hooks and comments
Seperated the creation and updating of the page