refactoring beta