Refactor the parse part