simplify events logic to on object