code cleanup, improved handler selection, resizer autoresize fixed