Some refactoring + the 4000 case