Further refactoring for readability