updating schema and templates
minor refactor