more sensible error reporting
abstract stuff in own module
expose