Minor refactors to `compose` and its tests