cleanup and coding style