refactored methods
refactored: created an general method for retrieving all data