Clean up code
Add events