Refactored finding the optional argument into an own function.
Rewrote checkout-index.