Refactor Z a bit, duplicating several functions as non-this using.