Refactor C Interface to hide implementation details