gamma refactor done