Cleans up the operator implementation, add versions for values.