refactor mta parser a bit