refactoring, start adding joins