Refactor control file and App