refactored to use interface