cleaning up code
removing unref var