Refactor to use class-based views