refactoring share variables.