simplified code a little