refactory contract module