Creating and handling application events