Type check on replace URL, ternary operators for getting options