Removed references to deprecated code
Refactored code based on changes to database