It is difficult enough to build quality software from the start of a project. It is much harder to take an existing application and improve it's quality (reliability, testability, adaptability, etc).
This additional difficulty to add quality after the fact is why you must not try to convert a throwaway prototype into a product. Make sure you
Build the Right Kind of Prototype.