Code refactoring and Readme update