refactored to interfaces