Fix - run conversion before inference and simplify code