Refactor, use Swift AppDelegate