Tidy Up code a bit