Refactoring +class_attribute+ to make it more readable.

Right now `class_attribute` is just a single large method that is hard to read. I'm refactoring it so that it is more readable by breaking it up into smaller methods.