refactored code that relied on the database and sitecore context into it's own method