* refactor after close function for #58