Refactor power of two challenge endpoint to make it more readable