Tidy up internals