Refactoring the Pocket API code

*Please don't bugger up this commit git :(