more inlining and bit hacks