refactory ecommon library.