adding some minor code improvements