Not really refactored, just easier to read.