replace NotImplementedException to InvalidException as suggestion by @ruflin