cleanup and add some missing stuff