Refactoring classes to use interfaces