Reorganize and privatize methods for docs

Fix tests