Cleanups and better events integration