Refactored index action in projects controller