remove lines and some refactor