refactored scaling and bool conversion