refactored join command