Refactoring to make the 'reward' commands more generic.