refactor module view templates to reduce duplication

@dannyroberts