Improving Rich Internet Applications Through Software Refactoring