minor refactoring + updated README.md

included Martijn's code review changes