some restructuring in mbeddr vs C99