added reversion
only rely on scalar values
added type utils
updated event handlers