move strip_heredoc into private method