Refactor parsing cases