Small refactoring and handling of multiple same CustomClass