Added minimize-on-open and filled in factory reset logic