Converted to class-based views. Code clean-up.