update structure, add templates