transform refactored