Refactor of main CBV and authentication test