added savedItems and recentItems and refactored code for them