better event binding implementation