Simplifying existing code for C interface.