Reworked structure a bit, added some events