neater and more efficient

saved a bit of code (its on more lines though)
saved a few lines

removed some repetitive code