refactor and reduced complexity of Offset