add support for thunk and promise; add coverage; some improvements