Clean up some internals