Better validation of the operations here would be nice.