Refactored solution to 'Longest Substring Without Repeating Characters'