Code improvements

Few code improvements