Rewriting loc class in C style struct