Smarter embed functionality