modify code refactor