Modified Readme and code refactoring