[BACKLOG-207] - Refactoring, unit tests