refactor project loading + remove some globals