refactored code and added logic to listen to a queue
separating objects and classes in seperate files