Promote some functions from testing file to real usage