Move untility functions around.