tiny bit of refactoring, added is_callable