improve the implementation to be fast by simplification.