Corrected typo in readme, some refactoring.