deduce refactor