As discussed in: https://github.com/cvasilak/aerogear-ios-sync/commit/274c2c18fd10ad6b58231795db8495a1aea44424#commitcomment-9774009
let's refactor this method