MINOR simplified code a bit