fixing bugs and cleaning
updating templates