Refactoring command execution on python-libraclient code