most of share, some refactor