refactoring to get a more affordable way to set offsets