Refactored to remove DB criteria in view