Refactor of scales to use bitmask storage