Move result dimension determination into separate functions
Added transform handler