slightly refactored whitelabelling function