bit refactoring & cleanup