Improved a lot of stuff and simplified the output view generation.