global refactoring to secure tests and user rate