code fixes, code improvements