Refactor templates file structure.