repository design refactoring (wip)