extract method to detect appropriate using cpu numbers