Refactor id offset