reorganized component and repository code into separate modules