refactored using generic class based views