refactor to make resource checking async - #1

see #1