nit: better to do mappings.length = 0