some refactory needed