Fix regression introduced by refactor