clean up some dead code, add a single function