[+Yanzay] Refactoring, measures testing added.