refactored read-only case