Combine two methods used to (dis)allow closing.
Add proper documentation