cleaned up/simplified code, no functional changes