More community template code clean up and refactoring.