Fixed bug where parser loops if valie for valid argument are missing and refactor variables