Refactoring to help understanding