updated to support configurable template file extension.