bit of cleanup, and made everything a class method.