Code cleanup, documentation.