transform as a top level function