Added event system and logger