a more convenient way of transforming objects