Major refactoring of variable and resource controllers.