refactored declaration of parser