better errors, more flexible