Pass txs and constants, add define, cleaner indent and reuse contract module