Working with legacy code