fixed read + refactoring