simplify mappings code, add asserts for nibs