common refactoring and more types support