#138, Custom events logic refactoring