Fix Event flags and refactor to use eviroment variable helper
This MR fixes #17 (closed) and additionally introduces some small code changes by refactoring a bit of code to use the recently introduced enviroment variable
This MR fixes #17 (closed) and additionally introduces some small code changes by refactoring a bit of code to use the recently introduced enviroment variable