fix 32-bit build
remove unused code; cleanup