Refactored solution 42