finished join logic refactoring. This needs to be tested. Known bug: popups and buttons are not disabled as expected during processing.