Refactored read method for readability.