refactoring and readme updated