slightly changed some FormMainImpl code.