Adding README.md and minor refactoring