add: pass from/to to onRefresh function and change lastRefresh by to/from vars (see previous commit)