Rework command parser code