Moved resource setting to constructor