A method for treating biomass, comprising: Impregnating the biomass with a reactant in an impregnation reactor unit prior to feeding the impregnated biomass to a pressurized prehydrolysis reactor unit; Feeding the impregnated biomass to the pressurized prehydrolysis reactor unit by means of a feeding system (5, 7), wherein by means of the feeding system (5, 7) the biomass is compressed, and wherein a filtrate is squeezed out of the biomass by means of the feeding system (5, 7); Wherein the biomass is fed to the impregnation reactor unit by means of a first plug screw of the feeding system (5, 7), wherein the impregnation reactor unit is partly filled with the reactant, and wherein the filtrate is squeezed out of the biomass by means of the first plug screw while the biomass is fed to the impregnation reactor unit by means of the first plug screw; and/or the filtrate is squeezed out of the impregnated biomass by means of a second plug screw of the feeding system (5, 7) while the impregnated biomass is fed to the pressurized prehydrolysis reactor unit by means of the second plug screw; Separating the filtrate from the biomass; Thermally treating the biomass in the pressurized prehydrolysis reactor unit to form a thermally treated biomass; Diluting the thermally treated biomass with the filtrate before the thermally treated biomass is discharged from the pressurized prehydrolysis reactor unit to form a diluted biomass and the filtrate supports an increase of the pH value up to around the suitable interval for enzyme stage around pH 5, between 4.75 and 5.25, or between 4.7 and 5.3 with less use of external chemicals, and also helps to stabilize the pH value around the suitable pH interval for enzyme stage around pH 5, between 4.75 and 5.25, or between 4.7 and 5.3, through buffering reactions during the enzymatic hydrolysis; Discharging the diluted biomass from the pressurized prehydrolysis reactor unit to form a discharged biomass; and Treating the discharged biomass with an enzyme. Impregnating the biomass with a reactant in an impregnation reactor unit prior to feeding the impregnated biomass to a pressurized prehydrolysis reactor unit; Feeding the impregnated biomass to the pressurized prehydrolysis reactor unit by means of a feeding system (5, 7), wherein by means of the feeding system (5, 7) the biomass is compressed, and wherein a filtrate is squeezed out of the biomass by means of the feeding system (5, 7); Wherein the biomass is fed to the impregnation reactor unit by means of a first plug screw of the feeding system (5, 7), wherein the impregnation reactor unit is partly filled with the reactant, and wherein the filtrate is squeezed out of the biomass by means of the first plug screw while the biomass is fed to the impregnation reactor unit by means of the first plug screw; and/or the filtrate is squeezed out of the impregnated biomass by means of a second plug screw of the feeding system (5, 7) while the impregnated biomass is fed to the pressurized prehydrolysis reactor unit by means of the second plug screw; Separating the filtrate from the biomass; Thermally treating the biomass in the pressurized prehydrolysis reactor unit to form a thermally treated biomass; Diluting the thermally treated biomass with the filtrate before the thermally treated biomass is discharged from the pressurized prehydrolysis reactor unit to form a diluted biomass and the filtrate supports an increase of the pH value up to around the suitable interval for enzyme stage around pH 5, between 4.75 and 5.25, or between 4.7 and 5.3 with less use of external chemicals, and also helps to stabilize the pH value around the suitable pH interval for enzyme stage around pH 5, between 4.75 and 5.25, or between 4.7 and 5.3, through buffering reactions during the enzymatic hydrolysis; Discharging the diluted biomass from the pressurized prehydrolysis reactor unit to form a discharged biomass; and Treating the discharged biomass with an enzyme.