JS service small refatoring