Code cleanup
Working on moving things to events