Implement more template parsing