modify BasicService template；clean code.