improved structure (but still broken)