Extract to Util::create_or_open
Refactor