Added test for the app class
Some small refactorings