Refactor MR code reload

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>