clean up and do some tests