Simplifications of Code an a little Bugfix