Clean-up/reorganize utils.c and utils.h a bit