Split utility code into separate files