Remove some unused code, fix type so BD works