Reindent and add _on_mode