You should pull this out into a private method since it's repeated so much. Also will help with debuggability.