Separate utility functions into util.py.
Write error descriptions to error log.