MDL-40563 improve coding style and robustness of style serving script