added event handling, refactored general structure, added guava