Update README.
Some refactoring of the code.