refactoring to improve readability