Changed C++ classes to C structs for less memory footprint