fixed mrc import and refactored a bit