step 5: creating the all class method to be used in the index action