Update readme and some code cleanup.