remove unneed def and refactor read to helper