refactoring for future use