refactored to use commander