code improvements

some improvements