Refactor duplicated boilerplate handler code to Shortcodes::Handler