split out utils.cpp as separate file