code refactor, readme improvements