Add join feature
Minor refactoring