refactory of former_helper