adding logging & separating out resource