Some refactoring + another join / prefetch tweak