Understanding the legacy code