Limit unecessary work on startup
Fix unit test