Add removeData function and corresponding tests