refactor bits