further code improvements