I'm working in this area currently, so I'll try to fix the indentation (and open a separate PR).