simplified code structure