refactored/designed the code to be modular
removed jms dependency