fix notice tpl + refacto code