make it all work with TOS stuff
minor cleanup