Refactor brew script to do various bits of brewing in chunks