add scanner creation in Template.java