Adding interfaces and refactoring