More cleanups, remove unrefed code, fix some names