add refactor before and update readme