Call resources events outside of locks
Refactor functors