refactored transformation