remove bugs and add some util classes.