refactor and some change