break location setup into own function