Move layout to seperate file
Turn error blocks into single function and template file