project loader code refactoring and tweaks