Major refactoring for static/CMS
More refactoring