Refactored gamma into a new class