clead up code a bit