Refactor joining