Revert "minor refactoring of transformObject"

This reverts commit e592f3b0cf1684f84c86a573d41afbc9d568b350.
wip commit because girlfriend