Extract core, and add documentation