cleanup & more informative error messages