Refactored transform and added pathauto compatibility.