refactored projects controller