refactored should_transform function to decorator