split code from main module