refactored whiten & unwhiten