Anorm refactoring: backport #2959