futher optimization of service calculation