Refactored the AppManager class and resolved #22