Added output template file support