Added reopen feature
Moved syntax in separate file