Is there a better way to ensure `@contents` is initialized?