did some refactor