created 2 files for frame listener and resource listener for more clarity