refine readme; some code cleanups