Refactored uniform setting.