Updated readme and code refactor