[refacto] introduce minimal "hook" system