Moved out from SelectWriter the join logic to its own class