6.7 almost need refactoring