reformat join and filter