begin of refactoring