Simplified handleCommand