Slight refactoring to increase code clarity