Same situation, maybe we should put this code in one place (for example class).