Refactor: Make events registration machanism simpler