command parser impl is refactored a little bit