Refactored avatar generation to use separate generator class