NXP-11820: handle default values for variables in templates, cleanup/factor out code and update tests