pull unused code, fill a missing test