Refactoring with best_practices