layout foundation and cleanup