First implementation of the template parser