implement file io for control method