Refactoring some minor features.