simplified code.