refactor parsing code
fix merge