refactor project logic