refactoring startup
resolve merge conflict
last thing added for r2
Merge branch 'r2_startup'