refactor rmq to object