cleanede some of the code