some refactor for the future