Refactoring Debug, layout changes, download on click. Regarding #520.