Small improvements on the mainfile