done some refucktoring