Documentation and cleanup of core