4.0: Split main code in tools