Refactor event handlers to use common function and data attribute