Refactored report util functions.