local refactor