minor code improvments