Reorganize internals