refactor + reflection