https://issues.apache.org/jira/browse/AMQ-5290

Clean up some code to make future work a bit simpler.