some cleaning and micro-optimization for startup time