Refactor work with reflection.