Refactor dependencies as interfaces