refactoring helper