start implementing template parsing