Remove import of modulestore and refactor save method.