finish the preliminary modularization on parser