some improvements of Code