clean up document