Change tab deprecated function into a fragment