References #123 - Cleaned up open/close logic