renamed a bunch of types & some minor refactorings