move listener to its own file