adding support for refresh and unit tests