refactored the jms support to make the same factory reusable