Refactored container repo to support pagination better.