refactor(bem.tree): simplified code with after-event