Improve offsetSet method