split lib and main script files