-- refactoring helper() method