Device optimization