refactored head away from templates