Better error handling, pluss refactored to PagesController