refactoring of cache logging code

* simplify control flow
* move sanity checks into GCVote and twitter methods