reorder rmg fetch logic and add some output