transform functions now take ctx