moving variables to template