Switch away from heredoc and start using a pipe