Refactoring + bug