Various cleanups, simplifications etc