Made changes asked in review by Tim Graham.

- Simplified checking and assigning the class attribute.
- Fixed documentation link.