refactored sign_in feature to macro