removed the unused field "ref" and also adjusted the coding style a bit.