Refactoring using interfaces