[PATCH 6/6] erp: refactor to eliminate references/put/remove