refactoring function signature for transformers