move wrapper into heredoc