make a generic error type for Checks
move check functionality in core package