changing CBV profile view to function