Refactoring of Repository

Changed way of getting/setting resources to mach #36 changes