Register method for defining events