refactored transformator