Refactored code to use base classes for persistence instead of interfaces