fix extends
fix templates compiling
add clean_templates command