refactoring for better readability