Refactored command