refacotred error objects