Refactoring - Replace type by reflect