refactored database pull for feed