minor code improvements