Main application structure