refactoring for readability