Draft ContentManager and TemplateEngine, refactoring