more minor code improvements