refactoring, 32/64bit API+tests