some small code improvements