fleshing out interface from Ruby to C
refactoring to better organize the codebase