First version with template