Resource manager almost completed (need tests)