Refactored get_commands into range based get_command calls.