Refactored to remove template and view services