add spec.
remove some unused code.