Refactored command parsing into Parser library and created new file and static method for it