Reorganize internals that have been converted into proper API