some improvements as suggested by lint