refactoring bug fix and readme updates