refactorization of parsers and fixed handling long outputs