smarter smart_join