some refactoring and another wrapper