@simong: Should these functions be moved out into a DAO or the internal util file?