immediate: cleanup and add documentation