code and coding style cleanup