some refactors for null