some refactors