Jms expiration refactor rebased

Code refactoring as per peer reviews