Optimized the jose code.