small code improvements