WIP -- fixed the duplicated event handler and now refactor to use the observer