remove reference
Tidy up the code