Moved utility funcs to new module