refactoring and readme improvments