reflection and refactor