Refactoring interface code