Refacotor and update header to CNAppDelegate