Refactoring to improve clarity