Reduced redundancy and explicitly cast strings to avoid potential cross-browser bugs.