it looks like you have the exact same code in two different places? does it make sense to make that it's own method and then call it from both places?