adapt: unify adaption code

Whether the result should be 3 or 4 lines should be a parameter to
the common adaption function instead of duplicating code. So change
it that way. Otherwise code maintenance becomes too difficult.