made even more event driven and fixed broken test functionality