Refactoring to improve readability