Improve command parsing