cleanup and fixes for extensibility