Simplify offsets code