[LFC] Move inflow, replaced width and margin computation to a dedicated function.