refactored transform