refactoring: a more precise duck typing here...