Refactor Application.java