[TASK] Refactoring + additional unit test