Relocated a lot of Stuff to make the code cleaner.