Fix imports, formatting, cleanup