Fix rebase conflict by moving block of code out