Improved shortcode generation