Improve example

Remove the uses of reference