i feel like this could be moved out to a function and called, rather than in here.