We may re-use this somewhere else. Can you put it in rugged.c without being static and add it to rugged.h?