few more tweaks and some refactoring, removed useless shims for example