refactoring to make the code base more like idiomatic Scala
streamlining events