Refactor shifting