Refactor getOperations