CON-2324 move methods to helper class and add unit tests