refactored filtering methods in order to use it for book AND loan