Moved some behaviour to one place

**What does this MR do?**
It moves some duplicated behaviour to one place

**Why is this MR needed?**
Well, its just a refactoring, doesn't fix anything, although it improves CodeClimate score a little
Good catch.. Weird i've ran the test locally but they did not complain =/ I'll fix that tonight!