Refactored name and command parsing