refact event design.