Migrate modes to lens + minor cleanup