code refectoring for compute Service