[ŧicket/34] Remove duplicated code
[ticket/34] Remove duplicate code from tests