Refactored most of the functionality to beercommon.py