Added possibility to choose template