some refactorings in SetupApplication.java to make it usable to other projects. Also added a lot of JavaDoc