refactored to one template