refactored parser to return a block