@thyms refactoring around layouts and templates.