refactor to use resolve, fixing bugs too
Release 1.1.0