combine some event handler setting script
DRY fixed
block comments added