fix inference issue and attempt at inlining