Porting the beginning of the templates