io impl & tests