Refactor system startup
Fix warnings