setup em-smart as a hook
various small changes