key transformation refactor