refactor repo creation/loading