Extract endpoints into their own objects - allowing for easier testing.