Refactor prepareProject