Refactored typehint to use interface instead of implementation