refactoring via RBP