add templates and fix schema