First refactoring working, transformation not working fine