refactoring: use interface types instead of implementation