some minor code improvements