The present invention relatesto the treatment of various waste and side flows of pulp and paper industry. The flows are treated in view of utilizing each one of the flows in the best possible manner, whereby only commercially interesting end products are produced. It requires a novel way of dividing and/or fractionating the flows between incinerationand treatment in a bio refinery. The end products may be, for instance, one or more of ethanol, methanol, fertilizer etc.