fixed DRY issue