Abstracted logic into helper method because JUnit.