Only register events when they are used