encapsulation of open function
clean better on close
Merge pull request #141 from adrai/open

encapsulation of open function