To rewrite or not to rewrite a software