refactor parse function
parse response