Fix Quick Run setting and some refactoring.