error handlers and moved models to common