Generated scaffolding for startup and fixed some layout on startup/show