some new code improvements