replace custom manager by a manager method, other tweaks, unit tests