Refactored test to command