avoid using resources and use lamdbas instead (fix compile error! omg)