better handling of error with better description and dry