change parser function to the return function and remove callback