Refactor exercise listener