refactor page listeners to module