Refactoring to make it more understandable.