I wasn't sure about making this an inner class but since it's only used here I didn't want to make it a standalone class either.