[in progress! use master branch instead] code improvements