New: Code cleanup, documentation