optimize and add idle sleep config