When I refactor legacy code