Some code cleanup.
Add application class.