Move utils to a module and separate ID generation functions