untangle some confusing point-free code