Code tidy up and CMS pages working