refactor structure of repository