overall code improvements