code improvements