Turning spaghetti into lasagne : applying the principles of application frameworks to packaged applications