Refactored App.java