Adding changes to createTemplate method