Small refactor for finding target for robot commands