Simplify setRes() and getRes()