Made loading function more readable.