Just a small changes

The first patch is just a small refactoring.
The second one changes the application behavior.