code cleanup and config-dist