some refactoring
read