some improvements to rust style