simplify file init code