* finish refactoring