minor cleanup and loading from stream