changing CBV to function views