Reduced the usage of IStartup to improve the startup performance. Also cleaned up some dead code.