Some refactoring. Readme.md has been updated.