DONE, moved to util and exposed as a function only.