Modularizing more old code