Refactoring of the non-closing stuff