Fix indent and small refactoring.