Improve util functions.