refactoring (not finish)