Refactored more code.
Updated README.