Cleaned up command parsing