Reduce dependency on activemq, use generics where possible.