Simplified code for selecting registers