removed and simplified code