refactor projects controller