refactor projects event listener