change resource events to lambdas