Fix naming and some refactor.