refactor out templates to the modules