refactor read and and getValue