simplify getCommandObjects method